NAME=relatorio
IMAGES=logo-ic-unicamp.eps logo-unicamp.eps
STYLES=logo-ic-unicamp.sty logo-unicamp.sty techrep-ic.sty abnt.bst sbc-template.sty

all: $(NAME).pdf

$(NAME).dvi : $(NAME).tex $(NAME).bib $(IMAGES) $(STYLES) plots
	latex $(NAME).tex
	bibtex $(NAME)
	latex $(NAME).tex
	latex $(NAME).tex

$(NAME).ps: $(NAME).dvi
	dvips -o $(NAME).ps $(NAME)

$(NAME).pdf: $(NAME).ps
	ps2pdf $(NAME).ps $(NAME).pdf

texonly: $(NAME).tex $(IMAGES) $(STYLES)
	latex $(NAME).tex
	dvips -o $(NAME).ps $(NAME)
	ps2pdf $(NAME).ps $(NAME).pdf

plots: $(NAME).plot
	gnuplot <$(NAME).plot
	touch $(NAME).tex

clean:
	rm -rf $(NAME).{aux,ps,dvi,log,blg,bbl}

.PHONY: clean plots
